package com.headhunter.company;

import java.rmi.*;
import com.headhunter.server.Company;

/**
 * Class that binds Company implementation to the rmi registry and starts the
 * server
 * 
 * @author gokhan
 * 
 */
public class CompanyServer {

	// Start "rmiregistry &" before running this
	public static void main(String[] args) {
		System.setSecurityManager(new RMISecurityManager());
		try {
			Company company = new CompanyImpl();
			String url = "rmi://localhost:1099/Company";
			Naming.rebind(url, company);
			System.out.println("Starting Company server");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}